home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13924 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: news.interlog.com!news
  2. From: irish01@interlog.com (Brian Aitken)
  3. Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
  4. Subject: Re: Calling all API experts !!
  5. Date: 28 Mar 1996 00:34:05 GMT
  6. Organization: WebBuilders Inc.
  7. Message-ID: <4jcmpt$cpf@steel.interlog.com>
  8. References: <DoIMG1.F9y@unx.sas.com> <314fa69d.8181856@news>
  9. NNTP-Posting-Host: irish01.interlog.com
  10. X-Newsreader: WinVN 0.99.5
  11.  
  12. In article <314fa69d.8181856@news>, bking@primenet.com says...
  13. >
  14. >On Tue, 19 Mar 1996 12:52:49 GMT, sdkkah@mvs.sas.com wrote:
  15. >
  16. >>
  17. >>Hi, world
  18. >>
  19. >>I am trying to make an application with a tool which just recently allowed
  20. >>calling Windows API's. The tool (The SAS System) itself is written in C++.
  21. >>Some API's works OK, but there's one I cant figure out how to use right.
  22. >>Its called GetProfileString. I need to access the [fonts] section of WIN.INI,
  23. >>and get all entries and values. But I dont know the number of entries to
  24. >>read, since this obviously varies. Is there some kind of trick that would
  25. >>allow me to loop through untill the last entry is read, without having to
  26. >>know the exact number of entries in each section ? 
  27. >>
  28. >>Getting the font names is just getting me half the way. I also need to
  29. >>know the point size and property (Bold,Italic etc..). Does anyone know
  30. >>where I can get this information ?
  31. >>
  32. >>Finally, can anyone recommend any good documentations as to how
  33. >>Windows API's are dealt with in general ?
  34. >>
  35. >>All kind of help is appreciated.
  36. >>
  37. >You can skip the API when it comes to reading INI files.  Use the
  38. >TIniFile object, it has a method called "ReadSection", this will read
  39. >all keys into a TStringList then you can loop through each element in
  40. >the list and read the values associated with the key with the
  41. >ReadString method of the TIniFile.  Once you have built the list of
  42. >fonts, you can use the API function GetTextMetrics which will return a
  43. >lot of (if not all) the information you need.
  44. >
  45. >
  46.  
  47. If you read what the guy says he is trying to use an API call from
  48. SAS/C++ NOT Delphi ...
  49.  
  50. I suggest he use the GetProfileSection API call ... this will get ALL
  51. the name/key values at one fell swoop. It's documented in the C++
  52. manual and in the SDK.
  53. -- 
  54. **************************************************
  55. Brian Aitken
  56. WebBuilders Inc.
  57. **************************************************
  58.  
  59.